package gui.newComponent;

import javax.swing.*;
import javax.swing.text.Document;
import java.awt.*;
import java.awt.event.KeyListener;
import java.awt.event.KeyEvent;

public class FWLabelTextField extends JTextField{

    JLabel label = new JLabel("test");
    JTextField textField = new JTextField();
    JPanel panel = new JPanel(new FlowLayout());

    public FWLabelTextField(){
        this.setLayout(new FlowLayout(10));
        this.setText("TTest");
        this.addKeyListener(new KeyListener() {
            public void keyTyped(KeyEvent e) {
            }

            public void keyPressed(KeyEvent e) {
                label.setText(label.getText()+"1");
            }


            public void keyReleased(KeyEvent e) {
            }
        });
        label.setLabelFor(this);
        this.add(label);
    }

}
